<template>
  <div>
    <el-dialog title="收货地址" :visible.sync="flag.isShow" @opened="opened" @closed="closed">
      <el-form :model="form">
        <el-form-item label="活动名称" label-width="120px">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="活动区域" label-width="120px">
          <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel">取消</el-button>
        <el-button type="primary" @click="change">修改</el-button>
        <el-button type="primary" @click="add">添加</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  data() {
    return {
        form:{}
    };
  },
  mixins:[],
  props: ["flag"],
  computed: {
    ...mapGetters({})
  },
  components: {},
  methods: {
    ...mapActions({}),
    // 取消
    cancel(){
        flag.isShow = false
    },
    // 修改
    change(){
        flag.isShow = false
    },
    // 添加
    add(){
        flag.isShow = false
    },
    // 打开时
    opened(){},
    // 关闭时
    closed(){
        if(!this.flag.add){
            this.clear()
        }
    },
    // 清空
    clear(){
        this.form={}
    },
  },
  mounted() {}
};
</script>
<style lang='less' scoped>
</style>